﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using FluentNHibernate.Automapping.Alterations;
using FluentNHibernate.Automapping;

namespace Domain.Model.Mapping.Overrides
{
    public class FormMappingOverride : IAutoMappingOverride<Form>
    {
        public void Override(AutoMapping<Form> mapping)
        {
            mapping.HasMany<FormElement>(x => x.FormElements)
                .Cascade.All()
                .Inverse()
                .Not.LazyLoad()
                .OrderBy("Position")
                .AsBag();

        }
    }
}